package com.qiniuyun.graph.common.utils;

import com.qiniuyun.graph.common.enums.ErrorCodeEnum;
import com.qiniuyun.graph.common.vo.ResultVO;

public class ResultVOUtil {
    private static final String SUCCESS_MSG = "success";


    public static ResultVO success(Object object) {
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(ErrorCodeEnum.E000.code());
        resultVO.setMessage(SUCCESS_MSG);
        resultVO.setData(object);
        return resultVO;
    }

    public static ResultVO success() {
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(ErrorCodeEnum.E000.code());
        resultVO.setMessage(SUCCESS_MSG);
        return resultVO;
    }

    public static ResultVO error(String code, String msg) {
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(code);
        resultVO.setMessage(msg);
        return resultVO;
    }
}